package cn.edu.lcu.cs.javaprogramming.oop.innerclass;

/**
 * @author ling
 * @date 2022/5/4 21:28
 */
public class EmployeeClient {
    public static void main(String[] args) {
        // 测试代码略 ……
    }

    /**
     * 比较两个雇员的工资
     *
     * @param e1
     * @param e2
     * @return
     */
    public int compareEmployeeSalary(Employee e1, Employee e2) {
        Comparator<Employee> comparator = new Comparator<Employee>() {
            @Override
            public int compare(Employee e1, Employee e2) {
                return e1.getSalary().compareTo(e2.getSalary());
            }
        };
        return comparator.compare(e1, e2);
    }
}
